/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.model.objects;

/**
 * <p>This class represents the animating an object's position, rotation and scale values over time. The class performs
 * an affine transformations with respect to a single action point. The transform operation is applied in the following
 * order: translate to (actionPointX, actionPointY), scale, rotate, translate back to origin and finally translate to
 * (x, y). It is a simple JavaBean (POJO) that provides getters and setters for all private attributes and performs no
 * argument validation in the setters.</p>
 *
 * <p><strong>Thread safety:</strong> This class is mutable and not thread safe.</p>
 *
 * @author saarixx, jmn
 * @version 1.0
 */
public class XRETransformAnimation extends XREAnimationResource {

    /**
     * <p>The desired x position, with respect to the view's parent, end of the animation, in pixels.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private int x;

    /**
     * <p>The desired y position, with respect to the view's parent, end of the animation, in pixels.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private int y;

    /**
     * <p>The desired scale multiplier along the x-axis.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private double scaleX = 1.0;

    /**
     * <p>The desired scale multiplier along the y-axis.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private double scaleY = 1.0;

    /**
     * <p>The rotation amount, in radians.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private double rotation;

    /**
     * <p>The point along the x-axis to use as the action point for interpolation.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private int actionPointX;

    /**
     * <p>The point along the y-axis to use as the action point for interpolation.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private int actionPointY;

    /**
     * <p>Creates new instance of {@link XRETransformAnimation} class.</p>
     */
    public XRETransformAnimation() {
        // empty constructor
    }

    /**
     * <p>Retrieves the desired x position, with respect to the view's parent, end of the animation, in pixels.</p>
     *
     * @return the desired x position, with respect to the view's parent, end of the animation, in pixels
     */
    public int getX() {
        return x;
    }

    /**
     * <p>Sets the desired x position, with respect to the view's parent, end of the animation, in pixels.</p>
     *
     * @param x the desired x position, with respect to the view's parent, end of the animation, in pixels
     */
    public void setX(int x) {
        this.x = x;
    }

    /**
     * <p>Retrieves the desired y position, with respect to the view's parent, end of the animation, in pixels.</p>
     *
     * @return the desired y position, with respect to the view's parent, end of the animation, in pixels
     */
    public int getY() {
        return y;
    }

    /**
     * <p>Sets the desired y position, with respect to the view's parent, end of the animation, in pixels.</p>
     *
     * @param y the desired y position, with respect to the view's parent, end of the animation, in pixels
     */
    public void setY(int y) {
        this.y = y;
    }

    /**
     * <p>Retrieves the desired scale multiplier along the x-axis.</p>
     *
     * @return the desired scale multiplier along the x-axis
     */
    public double getScaleX() {
        return scaleX;
    }

    /**
     * <p>Sets the desired scale multiplier along the x-axis.</p>
     *
     * @param scaleX the desired scale multiplier along the x-axis
     */
    public void setScaleX(double scaleX) {
        this.scaleX = scaleX;
    }

    /**
     * <p>Retrieves the desired scale multiplier along the y-axis.</p>
     *
     * @return the desired scale multiplier along the y-axis
     */
    public double getScaleY() {
        return scaleY;
    }

    /**
     * <p>Sets the desired scale multiplier along the y-axis.</p>
     *
     * @param scaleY the desired scale multiplier along the y-axis
     */
    public void setScaleY(double scaleY) {
        this.scaleY = scaleY;
    }

    /**
     * <p>Retrieves the rotation amount, in radians.</p>
     *
     * @return the rotation amount, in radians
     */
    public double getRotation() {
        return rotation;
    }

    /**
     * <p>Sets the rotation amount, in radians.</p>
     *
     * @param rotation the rotation amount, in radians
     */
    public void setRotation(double rotation) {
        this.rotation = rotation;
    }

    /**
     * <p>Retrieves the point along the x-axis to use as the action point for interpolation.</p>
     *
     * @return the point along the x-axis to use as the action point for interpolation
     */
    public int getActionPointX() {
        return actionPointX;
    }

    /**
     * <p>Sets the point along the x-axis to use as the action point for interpolation.</p>
     *
     * @param actionPointX the point along the x-axis to use as the action point for interpolation
     */
    public void setActionPointX(int actionPointX) {
        this.actionPointX = actionPointX;
    }

    /**
     * <p>Retrieves the point along the y-axis to use as the action point for interpolation.</p>
     *
     * @return the point along the y-axis to use as the action point for interpolation
     */
    public int getActionPointY() {
        return actionPointY;
    }

    /**
     * <p>Sets the point along the y-axis to use as the action point for interpolation.</p>
     *
     * @param actionPointY the point along the y-axis to use as the action point for interpolation
     */
    public void setActionPointY(int actionPointY) {
        this.actionPointY = actionPointY;
    }
}

